#import old_adaboost
import adaboost
from numpy import *
datArr,labelArr = adaboost.loadDataSet('horseColicTraining2.txt');
print("datArr\n",datArr)
print("labelArr\n",labelArr)
classifierArray,aggClassEst = adaboost.adaBoostTrainDS(datArr,labelArr,10)
print("classifierArray\n",classifierArray[0])
testArr,testLabelArr = adaboost.loadDataSet('horseColicTest2.txt');
prediction10 = adaboost.adaClassify(testArr,classifierArray)
#预测马疾病死亡概率
errArr = mat(ones((67,1)))
print("errArr[prediction10 != mat(testLabelArr).T].sum()\n",errArr[prediction10 != mat(testLabelArr).T].sum());

#非均衡类问题
adaboost.plotROC(aggClassEst.T,labelArr)